home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / splitter / split2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-02-06  |  4.2 KB  |  134 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5955
  5.    ClientLeft      =   1170
  6.    ClientTop       =   2295
  7.    ClientWidth     =   5670
  8.    Height          =   6645
  9.    Icon            =   "Split2.frx":0000
  10.    Left            =   1110
  11.    LinkTopic       =   "Form1"
  12.    MouseIcon       =   "Split2.frx":0442
  13.    ScaleHeight     =   397
  14.    ScaleMode       =   3  'Pixel
  15.    ScaleWidth      =   378
  16.    Top             =   1665
  17.    Width           =   5790
  18.    Begin VB.PictureBox Sbar 
  19.       Align           =   2  'Align Bottom
  20.       Height          =   315
  21.       Left            =   0
  22.       ScaleHeight     =   255
  23.       ScaleWidth      =   5610
  24.       TabIndex        =   3
  25.       Top             =   5640
  26.       Width           =   5670
  27.    End
  28.    Begin VB.PictureBox Splitter 
  29.       Appearance      =   0  'Flat
  30.       BorderStyle     =   0  'None
  31.       ForeColor       =   &H80000008&
  32.       Height          =   4215
  33.       Left            =   2760
  34.       MouseIcon       =   "Split2.frx":0594
  35.       MousePointer    =   99  'Custom
  36.       ScaleHeight     =   281
  37.       ScaleMode       =   3  'Pixel
  38.       ScaleWidth      =   9
  39.       TabIndex        =   2
  40.       TabStop         =   0   'False
  41.       Top             =   540
  42.       Width           =   135
  43.    End
  44.    Begin VB.ListBox lstTel 
  45.       Height          =   4350
  46.       IntegralHeight  =   0   'False
  47.       Left            =   3180
  48.       TabIndex        =   1
  49.       Top             =   120
  50.       Width           =   2235
  51.    End
  52.    Begin VB.ListBox lstpers 
  53.       Height          =   4935
  54.       IntegralHeight  =   0   'False
  55.       Left            =   60
  56.       TabIndex        =   0
  57.       Top             =   180
  58.       Width           =   2475
  59.    End
  60.    Begin VB.Menu mnuBar 
  61.       Caption         =   "&Exit"
  62.       Index           =   100
  63.    End
  64. Attribute VB_Name = "form1"
  65. Attribute VB_Creatable = False
  66. Attribute VB_Exposed = False
  67. Option Explicit
  68. Private Const P_ECART = 3
  69. Private y1 As Integer
  70. Private y2 As Integer
  71. Private x1 As Integer
  72. Private x2 As Integer
  73. Private width1 As Integer
  74. Private width2 As Integer
  75. Private height1 As Integer
  76. Private height2 As Integer
  77. Private glbfrmInSizeX As Long
  78. Private Sub Form_Load()
  79.     glbfrmInSizeX = &H7FFFFFFF
  80.     Form_Resize
  81. End Sub
  82. Private Sub splitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  83.     If glbfrmInSizeX <> &H7FFFFFFF Then
  84.         If CLng(x) <> glbfrmInSizeX Then
  85.             Splitter.Move Splitter.Left + x, y1, P_ECART, ScaleHeight - Sbar.Height - 2
  86.             glbfrmInSizeX = CLng(x)
  87.         End If
  88.     End If
  89. End Sub
  90. Private Sub splitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  91.     If glbfrmInSizeX <> &H7FFFFFFF Then
  92.         If CLng(x) <> glbfrmInSizeX Then
  93.             Splitter.Move Splitter.Left + x, y1, P_ECART, ScaleHeight - Sbar.Height - 2
  94.         End If
  95.         glbfrmInSizeX = &H7FFFFFFF
  96.         Splitter.BackColor = &H8000000F
  97.         If Splitter.Left > 60 And Splitter.Left < (ScaleWidth - 60) Then
  98.             LstPers.Width = Splitter.Left - LstPers.Left
  99.         ElseIf Splitter.Left < 60 Then
  100.             LstPers.Width = 60
  101.         Else
  102.             LstPers.Width = ScaleWidth - 60
  103.         End If
  104.         Form_Resize
  105.     End If
  106. End Sub
  107. Private Sub splitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  108.     If Button = vbLeftButton Then
  109.         Splitter.BackColor = &H808080
  110.         glbfrmInSizeX = CLng(x)
  111.     Else
  112.         If glbfrmInSizeX <> &H7FFFFFFF Then
  113.             splitter_MouseUp Button, Shift, x, y
  114.         End If
  115.         glbfrmInSizeX = &H7FFFFFFF
  116.     End If
  117. End Sub
  118. Private Sub Form_Resize()
  119.     Const B_ECART = 1
  120.     On Error Resume Next
  121.     y1 = B_ECART
  122.     height1 = ScaleHeight - Sbar.Height - B_ECART * 2
  123.     x1 = B_ECART
  124.     width1 = LstPers.Width
  125.     x2 = x1 + LstPers.Width + P_ECART - 1
  126.     width2 = ScaleWidth - x2 - B_ECART
  127.     LstPers.Move x1 - 1, y1, width1, height1
  128.     lstTel.Move x2, y1, width2 + 1, height1
  129.     Splitter.Move x1 + LstPers.Width - 1, y1, P_ECART, height1
  130. End Sub
  131. Private Sub mnuBar_Click(Index As Integer)
  132.     Unload Me
  133. End Sub
  134.